/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.mldn.demo;

/**
 *
 * @author Administrator
 */
public class InterfaceCaseDemo03 {
    public static void main(String[] args) {
        Fruit f = new Apple();
        f.eat();
        f = new Orange();
        f.eat();
    }
}

interface Fruit{
    public void eat();
}

class Apple implements Fruit{
    
    public void eat() {
        System.out.println("** 吃苹果");
    }    
}

class Orange implements Fruit{

    public void eat() {
        System.out.println("** 吃橙子");
    }
    
}